/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @file SpiSlave_Cfg.h
 * @brief AutoSAR SPI configuration header file
 * @details Automatically generated by user settings
 * @date 2025-03-25 19:03:22
 */

#ifndef SPI_SLV_CFG_H
#define SPI_SLV_CFG_H

#ifdef __cplusplus
extern "C" {
#endif

#include "Part.h"

#define SPI_SLV_MAX_CORES CPU_MAX_CORE_NUMBER
/*******************************************************************************
**                      Include Section                                       **
*******************************************************************************/

#define SPI_SLV_AR_RELEASE_MAJOR_VERSION_VALUE 4U
#define SPI_SLV_AR_RELEASE_MINOR_VERSION_VALUE 3U
#define SPI_SLV_AR_RELEASE_REVISION_VERSION_VALUE 1U

#define SPI_SLV_SW_MAJOR_VERSION_VALUE  1U
#define SPI_SLV_SW_MINOR_VERSION_VALUE  0U
#define SPI_SLV_SW_PATCH_VERSION_VALUE  0U

/* Instance ID of the SPI SpiSlaveDriver*/
#define SPI_SLV_INSTANCE_ID_VALUE 0U

#define SPI_SLV_VENDOR_ID_VALUE 0x8C
#define SPI_SLV_MODULE_ID_VALUE 2048U


/* Number of SpiSlave_Slave Drivers configured */
#define SPI_SLV_TOTAL_DRIVERS                     1U
/* Total Number of HW units configured*/
#define SPI_SLV_TOTAL_HW_COUNT      14U
/* Total Number of SpiSlaveChannel configured */
#define SPI_SLV_TOTAL_CH_COUNT	1U
/*  Total Number of SpiSlaveJob configured */
#define SPI_SLV_TOTAL_JOB_COUNT	1U
/* Total  Number of SpiSlaveSequence configured */
#define SPI_SLV_TOTAL_SEQ_COUNT	1U
/* Total  Number of device configured */
#define SPI_SLV_TOTAL_DEV_COUNT	SPI_SLV_TOTAL_JOB_COUNT

#define SPI_SLV_MAX_CHANNEL     SPI_SLV_TOTAL_CH_COUNT
#define SPI_SLV_MAX_JOB         SPI_SLV_TOTAL_JOB_COUNT
#define SPI_SLV_MAX_SEQUENCE    SPI_SLV_TOTAL_SEQ_COUNT

/*Reference to configured DEM event to report "Hardware failure". If the reference is not configured the error shall not be reported.*/
#define SPI_SLV_E_HARDWARE_ERROR (STD_OFF)


#define SPI_SLV_ENABLE_DMA  (STD_OFF)

#define SPI_SLV_BUFF_ALIGN_LEN  (CACHE_SIZE)

#define SPI_SLV_BUFF_SIZE_ROUNDUP_LEN  (CACHE_SIZE)

/*Switches the SpiSlave_Cancel function ON or OFF.*/
#define	SPI_SLV_CANCEL_API	(STD_ON)

/* Specifies whether concurrent SpiSlave_SyncTransmit() is supported */
#define SPI_SLV_SUPPORT_CONCURRENT_SYNC_TRANSMIT  (STD_ON)

/* Selects the SPI Handler/Driver Channel Buffers usage allowed and
*delivered.
*IB = 0; EB = 1; IB/EB = 2;
*/
#define SPI_SLV_CHANNEL_BUFFERS_ALLOWED 0x2U

/* Switches the development error detection and notification on or off. */
#define SPI_SLV_DEV_ERROR_DETECT  (STD_ON)

/* Switches the SpiSlave_GetHWUnitStatus function ON or OFF. */
#define SPI_SLV_HW_STATUS_API  (STD_ON)

/* Switches the Interruptible Sequences handling functionality ON or OFF. */
#define SPI_SLV_INTERRUPTIBLE_SEQ_ALLOWED  (STD_ON)
#define SPI_SLV_MAX_RETRY_TIMES 20U

/* Selects the SPI Handler/Driver level of scalable functionality that is available and delivered. */
#define SPI_SLV_LEVEL_DELIVERED SPI_SLV_LEVEL_2

/* This parameter defines the cycle time of the function SpiSlave_MainFunction_Handling in seconds. The parameter is not used by the driver it self, but it is used by upper layer. */


/*Configuration: SPI_SLV_VERSION_INFO_API
- if STD_ON, Function SpiSlave_GetVersionInfo is available
- if STD_OFF,Function SpiSlave_GetVersionInfo is not available
*/
#define SPI_SLV_VERSION_INFO_API	(STD_ON)

/** \brief  Configuration: SPI_NO_CACHEABLE_NEEDED
- if STD_ON, SpiSlava driver will not include dcache maintain code.
- if STD_OFF,SpiSlava driver will include dcache maintain code.
*/
#define SPI_SLV_NO_CACHEABLE_NEEDED	(STD_OFF)

#define ENABLE_SLAVE_MCS_TRIG	(STD_ON)



#define	SPI_SLV_SINGLE_CORE_HANDLER	 STD_ON
#define	SPI_SLV_SINGLE_CORE_ID	     (0u)
#define	SPI_SLV_CFG_CORES	         (1U)
#define SPI_SLV_CFG_ENABLE_CORE0     STD_ON
#define SPI_SLV_CFG_ENABLE_CORE1     STD_OFF
#define SPI_SLV_CFG_ENABLE_CORE2     STD_OFF
#define SPI_SLV_CFG_ENABLE_CORE3     STD_OFF
#define SPI_SLV_CFG_ENABLE_CORE4     STD_OFF


/* Handle for configured SpiSlaveChannel */
#define SpiSlaveConf_SpiSlaveChannel_SpiSlaveChannel_0  ((SpiSlave_ChannelType)0U)


/* Handle for configured SpiSlaveJob */
#define SpiSlaveConf_SpiSlaveJob_SpiSlaveJob_0  ((SpiSlave_JobType)0U)

/* Handle for configured SpiSlaveSequence */
#define SpiSlaveConf_SpiSlaveSequence_SpiSlaveSequence_0  ((SpiSlave_SequenceType)0U)


/* Handles for external  HW unit USED  */
#define SPI_SLV_CSIB1 ((SpiSlave_HWUnitType)0U)
#define SPI_SLV_CSIB2 ((SpiSlave_HWUnitType)1U)
#define SPI_SLV_CSIB3 ((SpiSlave_HWUnitType)2U)
#define SPI_SLV_CSIB4 ((SpiSlave_HWUnitType)3U)
#define SPI_SLV_CSIB5 ((SpiSlave_HWUnitType)4U)
#define SPI_SLV_CSIB6 ((SpiSlave_HWUnitType)5U)
#define SPI_SLV_CSIB7 ((SpiSlave_HWUnitType)6U)
#define SPI_SLV_CSIB8 ((SpiSlave_HWUnitType)7U)
#define SPI_SLV_CSIB9 ((SpiSlave_HWUnitType)8U)
#define SPI_SLV_CSIB10 ((SpiSlave_HWUnitType)9U)
#define SPI_SLV_CSIB11 ((SpiSlave_HWUnitType)10U)
#define SPI_SLV_CSIB12 ((SpiSlave_HWUnitType)11U)
#define SPI_SLV_CSIB13 ((SpiSlave_HWUnitType)12U)
#define SPI_SLV_CSIB14 ((SpiSlave_HWUnitType)13U)
/* Handles for Chip Select(Slave select) allocated to the Job*/
/* 16 slave select pins are available */
#define SPI_SLV_CS_0 (0U)
#define SPI_SLV_CS_1 (1U)
#define SPI_SLV_CS_2 (2U)
#define SPI_SLV_CS_3 (3U)
#define SPI_SLV_CS_4 (4U)
#define SPI_SLV_CS_5 (5U)


/* write buffers size*/
#define SPI_SLV_BUFFER_SIZE_CHANNEL_0  (970U)

/* Switche to enable or disable Hardware loop back . */
#define SPI_SLV_HW_LOOPBACK STD_OFF


#ifdef __cplusplus
}
#endif

#endif  /* SPI_CFG_H */

/*******************************************************************************
**                          End Of File                                       **
*******************************************************************************/
